﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Handrise.CDCable.Mobile.Business;

namespace Handrise.CDCable.Mobile.UI
{
    public partial class FrmDeviceDetail : FrmBase
    {
        private string parentForm;
        private Device device;

        private DeviceService deviceService = new DeviceService();

        public FrmDeviceDetail()
        {
            InitializeComponent();
            ttlbrhead.Text = "台账详情";
            ilstbcup.Images.Add(ResourceImage.GIS01);
            ilstbcup.Images.Add(ResourceImage.空白);
            ilstbcup.Images.Add(ResourceImage.返回01);
            ilstdown.Images.Add(ResourceImage.GIS02);
            ilstdown.Images.Add(ResourceImage.空白);
            ilstdown.Images.Add(ResourceImage.返回02);

        }

        private void FrmDeviceDetail_Load(object sender, EventArgs e)
        {
            if (IsReturn)
                LoadCacheData();
            else
                LoadData();

            tbDeviceTitle.Text = "设备详细信息";

            //获取设备详情
            object deviceDetail = deviceService.GetDeviceDetail(device.DeviceID);
            if (deviceDetail != null)
            {
                SetDeviceTitle(device.DeviceType);
                ccDeviceDetail.DataSource = deviceDetail;
                ccDeviceDetail.DataBind();
            }
            lblDevicePageInfo.Text = ccDeviceDetail.CurrPageIndex.ToString() + "/" + ccDeviceDetail.PageCount.ToString();
     
        }

        /// <summary>
        /// 加载数据
        /// </summary>
        private void LoadData()
        {
            parentForm = (string)Parameter[0];
            device = (Device)Parameter[1];
        }

        /// <summary>
        /// 加载缓存数据
        /// </summary>
        private void LoadCacheData()
        {
            parentForm = (string)Caches[0];
            device = (Device)Caches[1];
        }

        /// <summary>
        /// 设置设备详情标题
        /// </summary>
        /// <param name="deviceType"></param>
        private void SetDeviceTitle(string deviceType)
        {
            ccDeviceDetail.ClearAllMember();
            ccDeviceDetail.AddMember("Device.Name", "设备名称");
            ccDeviceDetail.AddMember("Device.DeviceType", "设备类型");
            ccDeviceDetail.AddMember("Device.Code", "设备编码");
            ccDeviceDetail.AddMember("Device.ParentDeviceName", "所属设备");
            ccDeviceDetail.AddMember("Device.VoltageLevel", "电压等级");

            switch (deviceType)
            {
                case "电缆小间":
                    ccDeviceDetail.AddMember("EM_Among.ENX", "东北x坐标");
                    ccDeviceDetail.AddMember("EM_Among.ENY", "东北y坐标");
                    ccDeviceDetail.AddMember("EM_Among.WNX", "西北x坐标");
                    ccDeviceDetail.AddMember("EM_Among.WNY", "西北y坐标");
                    ccDeviceDetail.AddMember("EM_Among.ESX", "东南x坐标");
                    ccDeviceDetail.AddMember("EM_Among.ESY", "东南y坐标");
                    ccDeviceDetail.AddMember("EM_Among.WSX", "西南x坐标");
                    ccDeviceDetail.AddMember("EM_Among.WSY", "西南y坐标");
                    ccDeviceDetail.AddMember("EM_Among.CONS_NAME", "施工单位");
                    ccDeviceDetail.AddMember("EM_Among.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Among.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Among.CONS_NAME", "施工单位");
                    break;
                case "避雷器":
                    ccDeviceDetail.AddMember("EM_Arre.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Arre.DISCHARGETYPE", "放电计数器型号");
                    ccDeviceDetail.AddMember("EM_Arre.ISSIGNALBOX", "有无信号抽取箱");
                    ccDeviceDetail.AddMember("EM_Arre.PHASE", "相位");
                    ccDeviceDetail.AddMember("EM_Arre.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Arre.CONS_NAME", "施工单位");
                    break;
                case "电缆段":
                    ccDeviceDetail.AddMember("EM_Cable.CARRCAP", "载流量");
                    ccDeviceDetail.AddMember("EM_Cable.RESISTANCE", "直流电阻");
                    ccDeviceDetail.AddMember("EM_Cable.CAPACITANCE", "电容");
                    ccDeviceDetail.AddMember("EM_Cable.POSISEQU", "正序阻抗");
                    ccDeviceDetail.AddMember("EM_Cable.ZEROSEQU", "零序阻抗");
                    ccDeviceDetail.AddMember("EM_Cable.LENGTH", "长度");
                    ccDeviceDetail.AddMember("EM_Cable.RUNENVI", "运行环境");
                    ccDeviceDetail.AddMember("EM_Cable.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Cable.BEGINSUBS", "首端变电站");
                    ccDeviceDetail.AddMember("EM_Cable.BEGINSCHE", "首端调度号");
                    ccDeviceDetail.AddMember("EM_Cable.ENDSUBS", "末段变电站");
                    ccDeviceDetail.AddMember("EM_Cable.ENDSCHE", "末段调度号");
                    ccDeviceDetail.AddMember("EM_Cable.STARTPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Cable.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Cable.PARAGRAPH", "段数");
                    ccDeviceDetail.AddMember("EM_Cable.COREAREA", "标称截面");
                    ccDeviceDetail.AddMember("EM_Cable.CONDUCTORDIA", "导体直径(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.CONDUCTORSCREENDIA", "导体屏蔽层厚度 (mm)");
                    ccDeviceDetail.AddMember("EM_Cable.INSULATETHICK", "绝缘厚度(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.WATERBLOCKCUSHIONTHICK", "绝缘屏蔽层厚(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.ALUMINIUMSHEATHTROUGHDIA", "阻水缓冲层厚度(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.ALUMINIUMSHEATHPEAKDIA", "铝套波谷直径Dit(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.CORRUGATEDALUMINIUMSHEATHTHICK", "皱纹铝套厚度ts(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.OVERSHEATHTHICK", "外护层厚度(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.OVERSHEATHDIA", "外护层直径(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.CONDUCTORRESISTANCE", "21℃时导体直流电阻(Ω/m)");
                    ccDeviceDetail.AddMember("EM_Cable.LAYINGMODE", "敷设方式");
                    ccDeviceDetail.AddMember("EM_Cable.CONDUCTORAXISSPACING", "导体轴心间距(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.METALSHEATHGROUNDING", "护套接地方式");
                    ccDeviceDetail.AddMember("EM_Cable.METALSHEATHLOSSFACTOR", "金属护套损耗因数");
                    ccDeviceDetail.AddMember("EM_Cable.CABLEENVIRONMENT", "电缆运行环境");
                    ccDeviceDetail.AddMember("EM_Cable.SOAKING", "有无浸水");
                    ccDeviceDetail.AddMember("EM_Cable.FIBERLOCATIONTYPE", "光纤测量位置：1-表面 3-内部");
                    ccDeviceDetail.AddMember("EM_Cable.FIBERLOCATION", "环境测温敷设位置");
                    ccDeviceDetail.AddMember("EM_Cable.DISTANCETOCABLE", "环境测温相对于电缆的距离(mm)");
                    ccDeviceDetail.AddMember("EM_Cable.ISMASTLINE", "是否是线路主测温");
                    ccDeviceDetail.AddMember("EM_Cable.TERMBPOS", "测温光纤起点");
                    ccDeviceDetail.AddMember("EM_Cable.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Cable.PHASE", "相位");
                    ccDeviceDetail.AddMember("EM_Cable.TERMBDOT", "测温光纤起点点号");
                    ccDeviceDetail.AddMember("EM_Cable.TERMEDOT", "测温光纤终点点号");
                    ccDeviceDetail.AddMember("EM_Cable.TESTDOTCODE", "实时电流测点编号");
                    ccDeviceDetail.AddMember("EM_Cable.INREGIONAL", "地域属性");
                    ccDeviceDetail.AddMember("EM_Cable.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_Cable.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_Cable.ORDERNO", "电缆段在线路中的序号");
                    ccDeviceDetail.AddMember("EM_Cable.FIBERDESC", "光纤与隧道方向");
                    ccDeviceDetail.AddMember("EM_Cable.INGROUDPOINT", "电缆入地点");
                    break;
                case "摄像头":
                    ccDeviceDetail.AddMember("EM_Camera.UNIT", "单元编号");
                    ccDeviceDetail.AddMember("EM_Camera.NO", "视频源编号");
                    ccDeviceDetail.AddMember("EM_Camera.INSTALLUNIT", "安装单位");
                    ccDeviceDetail.AddMember("EM_Camera.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_Camera.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Camera.POSDESC", "位置描述");
                    ccDeviceDetail.AddMember("EM_Camera.RECORDTIMES", "自动录屏时长（分）");
                    ccDeviceDetail.AddMember("EM_Camera.TUNNELSEQUENCE", "隧道标准编码");
                    ccDeviceDetail.AddMember("EM_Camera.TUNNELNAME", "隧道名称");
                    ccDeviceDetail.AddMember("EM_Camera.ENTITYNAME", "标示");
                    break;
                case "摄像监控主机":
                    ccDeviceDetail.AddMember("EM_CameraMain.INSTALLUNIT", "安装单位");
                    ccDeviceDetail.AddMember("EM_CameraMain.IPURL", "分配IP");
                    break;
                case "涵洞":
                    ccDeviceDetail.AddMember("EM_Culvert.SECSIZE", "断面尺寸");
                    ccDeviceDetail.AddMember("EM_Culvert.LENGTH", "长度");
                    ccDeviceDetail.AddMember("EM_Culvert.WELLNUM", "井数量");
                    ccDeviceDetail.AddMember("EM_Culvert.BEGINPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Culvert.BPX", "起点x坐标");
                    ccDeviceDetail.AddMember("EM_Culvert.BPY", "起点y坐标");
                    ccDeviceDetail.AddMember("EM_Culvert.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Culvert.EPX", "终点x坐标");
                    ccDeviceDetail.AddMember("EM_Culvert.EPY", "终点y坐标");
                    ccDeviceDetail.AddMember("EM_Culvert.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Culvert.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Culvert.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Culvert.STRUCTURE", "结构形式");
                    ccDeviceDetail.AddMember("EM_Culvert.SECURITYLEVEL", "保障等级");
                    break;
                case "电子定位球":
                    ccDeviceDetail.AddMember("EM_ElectronicPosition.INSTALLUNIT", "安装单位");
                    ccDeviceDetail.AddMember("EM_ElectronicPosition.X坐标", "XCOOR");
                    ccDeviceDetail.AddMember("EM_ElectronicPosition.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_ElectronicPosition.POSDESC", "位置描述");
                    break;
                case "互联箱/接地箱":
                    ccDeviceDetail.AddMember("EM_Erou.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Erou.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Erou.INSURE", "绝缘电阻");
                    ccDeviceDetail.AddMember("EM_Erou.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Erou.TYPE", "类型");
                    ccDeviceDetail.AddMember("EM_Erou.GROUPNUM", "组号");
                    break;
                case "风机":
                    ccDeviceDetail.AddMember("EM_Fan.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Fan.PORT", "端口");
                    ccDeviceDetail.AddMember("EM_Fan.CHANNEL", "通道");
                    ccDeviceDetail.AddMember("EM_Fan.POSITION", "位置");
                    ccDeviceDetail.AddMember("EM_Fan.TUNNEL", "所在隧道");
                    ccDeviceDetail.AddMember("EM_Fan.TUNNEL_FDEVSEQUENCE", "所在隧道标准编码");
                    ccDeviceDetail.AddMember("EM_Fan.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_Fan.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Fan.RATEDCURRENT", "额定电流（A）");
                    ccDeviceDetail.AddMember("EM_Fan.RATEDPOWER", "额定功率（W）");
                    ccDeviceDetail.AddMember("EM_Fan.MAXEXHAUSTVOLUME", "最大排风量");
                    break;
                case "防火门":
                    ccDeviceDetail.AddMember("EM_FireDoor.DIMENSION", "规格尺寸");
                    ccDeviceDetail.AddMember("EM_FireDoor.XPOS", "x坐标");
                    ccDeviceDetail.AddMember("EM_FireDoor.YPOS", "y坐标");
                    ccDeviceDetail.AddMember("EM_FireDoor.POSDESC", "位置描述");
                    ccDeviceDetail.AddMember("EM_FireDoor.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_FireDoor.TUNNEL", "所在隧道");
                    ccDeviceDetail.AddMember("EM_FireDoor.TUNNEL_FDEVSEQUENCE", "所在隧道标准编码");
                    ccDeviceDetail.AddMember("EM_FireDoor.PORT", "端口");
                    ccDeviceDetail.AddMember("EM_FireDoor.CHANNEL", "通道");
                    break;
                case "门禁":
                    ccDeviceDetail.AddMember("EM_GateAccess.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_GateAccess.PORT", "端口");
                    ccDeviceDetail.AddMember("EM_GateAccess.CHANNEL", "通道");
                    ccDeviceDetail.AddMember("EM_GateAccess.POSITION", "位置");
                    ccDeviceDetail.AddMember("EM_GateAccess.TUNNEL", "所在隧道");
                    ccDeviceDetail.AddMember("EM_GateAccess.TUNNEL_FDEVSEQUENCE", "所在隧道标准编码");
                    ccDeviceDetail.AddMember("EM_GateAccess.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_GateAccess.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_GateAccess.DOORFAC", "门生产厂家");
                    ccDeviceDetail.AddMember("EM_GateAccess.DOORSIZE", "门尺寸");
                    ccDeviceDetail.AddMember("EM_GateAccess.DOORMODE", "门类型");
                    ccDeviceDetail.AddMember("EM_GateAccess.STSTION", "所在变电站");
                    ccDeviceDetail.AddMember("EM_GateAccess.STSTION_FDEVSEQUENCE", "所在变电站标准编码");
                    break;
                case "电缆接头":
                    ccDeviceDetail.AddMember("EM_Join.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Join.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Join.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Join.PHASE", "相位");
                    ccDeviceDetail.AddMember("EM_Join.TYPE", "类型");
                    ccDeviceDetail.AddMember("EM_Join.TERMBPOS", "测温光纤起点");
                    ccDeviceDetail.AddMember("EM_Join.TERMEPOS", "测温光纤终点");
                    ccDeviceDetail.AddMember("EM_Join.TERMBDOT", "测温光纤起点点号");
                    ccDeviceDetail.AddMember("EM_Join.TERMEDOT", "测温光纤终点点号");
                    ccDeviceDetail.AddMember("EM_Join.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_Join.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_Join.LOWWARNING", "低预警阈值");
                    ccDeviceDetail.AddMember("EM_Join.LOWALARM", "低报警阈值");
                    ccDeviceDetail.AddMember("EM_Join.TERMAREANO", "测温光纤区段号");
                    break;
                case "电缆线路":
                    ccDeviceDetail.AddMember("EM_Line.CARRCAP", "载流量");
                    ccDeviceDetail.AddMember("EM_Line.RESISTANCE", "直流电阻");
                    ccDeviceDetail.AddMember("EM_Line.CAPACITANCE", "电容");
                    ccDeviceDetail.AddMember("EM_Line.POSISEQU", "正序阻抗");
                    ccDeviceDetail.AddMember("EM_Line.ZEROSEQU", "零序阻抗");
                    ccDeviceDetail.AddMember("EM_Line.LENGTH", "长度");
                    ccDeviceDetail.AddMember("EM_Line.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Line.BEGINSUBS", "首端变电站");
                    ccDeviceDetail.AddMember("EM_Line.BEGINSCHE", "首端调度号");
                    ccDeviceDetail.AddMember("EM_Line.ENDSUBS", "末段变电站");
                    ccDeviceDetail.AddMember("EM_Line.ENDSCHE", "末段调度号");
                    ccDeviceDetail.AddMember("EM_Line.STARTPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Line.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Line.PARAGRAPH", "段数");
                    ccDeviceDetail.AddMember("EM_Line.TESTDOTCODE", "运行电流测点");
                    ccDeviceDetail.AddMember("EM_Line.RUNENVINAME", "运行环境");
                    ccDeviceDetail.AddMember("EM_Line.SECURITYLEVEL", "保障等级");
                    ccDeviceDetail.AddMember("EM_Line.TAPPEDLINE", "T接线路名称");
                    ccDeviceDetail.AddMember("EM_Line.ISTAPPED", "是否T接线路");
                    ccDeviceDetail.AddMember("EM_Line.TAPPEDPLACEDESC", "T接点位置描述");
                    ccDeviceDetail.AddMember("EM_Line.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_Line.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_Line.REAL_YC_P", "实时线路有功测点");
                    ccDeviceDetail.AddMember("EM_Line.REAL_YC_Q", "实时线路无功测点");
                    ccDeviceDetail.AddMember("EM_Line.CONS_NAME", "施工单位");
                    ccDeviceDetail.AddMember("EM_Line.OUTPOINTTYPE", "出站点线路类型");
                    ccDeviceDetail.AddMember("EM_Line.INPOINTTYPE", "进站点线路类型");
                    ccDeviceDetail.AddMember("EM_Line.LINESTYPE", "线路类型");
                    break;
                case "检查井监测仪":
                    ccDeviceDetail.AddMember("EM_Moin.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Moin.RTUCHANNEL_ID", "通道号");
                    break;
                case "气体测量仪":
                    ccDeviceDetail.AddMember("EM_MonitorGas.LINENAME", "隧道名称");
                    ccDeviceDetail.AddMember("EM_MonitorGas.TUNNELSEQUENCE", "隧道标准码");
                    ccDeviceDetail.AddMember("EM_MonitorGas.RTUCHANNEL_ID", "RTU通道号");
                    ccDeviceDetail.AddMember("EM_MonitorGas.POS", "位置");
                    ccDeviceDetail.AddMember("EM_MonitorGas.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_MonitorGas.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorGas.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorGas.LOWWARNING", "低预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorGas.LOWALARM", "低报警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorGas.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_MonitorGas.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_MonitorGas.DEATHAREA", "死区");
                    break;
                case "接地电流测量仪":
                    ccDeviceDetail.AddMember("EM_MonitoRgi.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.LINESEQUENCE", "线路id（标准码）");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.RTUCHANNEL_ID", "RTU通道号");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.POS", "位置");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.JOINT", "关联设备名称");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.CORRELATIVEID", "关联设备id（标准码）");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.PHASE", "相位");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.CORRELATIVETYPE", "关联设备类型");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.LOWWARNING", "低预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.LOWALARM", "低报警阈值");
                    ccDeviceDetail.AddMember("EM_MonitoRgi.DEATHAREA", "死区");
                    break;
                case "水位测量仪":
                    ccDeviceDetail.AddMember("EM_MonitorWater.LINENAME", "隧道名称");
                    ccDeviceDetail.AddMember("EM_MonitorWater.TUNNELSEQUENCE", "隧道标准码");
                    ccDeviceDetail.AddMember("EM_MonitorWater.RTUCHANNEL_ID", "RTU通道号");
                    ccDeviceDetail.AddMember("EM_MonitorWater.POS", "位置");
                    ccDeviceDetail.AddMember("EM_MonitorWater.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_MonitorWater.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorWater.HIGHTALARM", "高报警阈值（报警水位）");
                    ccDeviceDetail.AddMember("EM_MonitorWater.LOWWARNING", "低预警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorWater.LOWALARM", "低报警阈值");
                    ccDeviceDetail.AddMember("EM_MonitorWater.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_MonitorWater.YCOOR", "Y坐标");
                    break;
                case "网络设备":
                    ccDeviceDetail.AddMember("EM_Net.NETTYPE", "设备类型");
                    ccDeviceDetail.AddMember("EM_Net.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Net.CONFIGINFO", "配置信息");
                    break;
                case "PDA":
                    ccDeviceDetail.AddMember("EM_PDA.FPHON", "电话号码");
                    ccDeviceDetail.AddMember("EM_PDA.FUSEID", "使用者ID");
                    ccDeviceDetail.AddMember("EM_PDA.PDATYPE", "类型");
                    break;
                case "水泵":
                    ccDeviceDetail.AddMember("EM_Pump.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Pump.PORT", "端口");
                    ccDeviceDetail.AddMember("EM_Pump.CHANNEL", "通道");
                    ccDeviceDetail.AddMember("EM_Pump.POSITION", "位置");
                    ccDeviceDetail.AddMember("EM_Pump.TUNNEL", "所在隧道");
                    ccDeviceDetail.AddMember("EM_Pump.TUNNEL_FDEVSEQUENCE", "所在隧道标准编码");
                    ccDeviceDetail.AddMember("EM_Pump.XCOOR", "X坐标");
                    ccDeviceDetail.AddMember("EM_Pump.YCOOR", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Pump.RATEDCURRENT", "额定电流（A）");
                    ccDeviceDetail.AddMember("EM_Pump.RATEDPOWER", "额定功率（W）");
                    ccDeviceDetail.AddMember("EM_Pump.MAXDISPLACEMENT", "最大排水量");
                    break;
                case "监控RTU":
                    ccDeviceDetail.AddMember("EM_Rtu.NAME", "名称");
                    ccDeviceDetail.AddMember("EM_Rtu.EM_SUBSTATIONID", "所在变电站id");
                    ccDeviceDetail.AddMember("EM_Rtu.INSTALLUNIT", "安装单位");
                    ccDeviceDetail.AddMember("EM_Rtu.CHANNELNUMS", "通道数");
                    break;
                case "rtu通道表":
                    ccDeviceDetail.AddMember("EM_RtuChannel.RTUID", "RTUID");
                    ccDeviceDetail.AddMember("EM_RtuChannel.RTUNAME", "RTU名称");
                    break;
                case "服务器":
                    ccDeviceDetail.AddMember("EM_Service.OS", "操作系统");
                    ccDeviceDetail.AddMember("EM_Service.APP", "应用软件及版本");
                    ccDeviceDetail.AddMember("EM_Service.POS", "设备位置");
                    ccDeviceDetail.AddMember("EM_Service.CONFIGINFO", "配置信息");
                    break;
                case "变电站":
                    ccDeviceDetail.AddMember("EM_Substation.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Substation.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Substation.SUBVOLTAGE", "站电压");
                    break;
                case "电缆刀闸":
                    ccDeviceDetail.AddMember("EM_Swit.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Swit.RATED", "额定电流");
                    ccDeviceDetail.AddMember("EM_Swit.ISKNIFE", "有无地刀");
                    ccDeviceDetail.AddMember("EM_Swit.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Swit.CONS_NAME", "施工单位名称");
                    break;
                case "测温光纤":
                    ccDeviceDetail.AddMember("EM_Temfiber.LENGTH", "长度");
                    ccDeviceDetail.AddMember("EM_Temfiber.BPOS", "起站");
                    ccDeviceDetail.AddMember("EM_Temfiber.EPOS", "止站");
                    ccDeviceDetail.AddMember("EM_Temfiber.USED", "用途");
                    ccDeviceDetail.AddMember("EM_Temfiber.CHANNELNO", "占用通道号");
                    ccDeviceDetail.AddMember("EM_Temfiber.DOT_COUNT", "测点数目");
                    ccDeviceDetail.AddMember("EM_Temfiber.DOT_GAP", "测点间距");
                    ccDeviceDetail.AddMember("EM_Temfiber.INIT_GAP", "光纤起始点距离");
                    ccDeviceDetail.AddMember("EM_Temfiber.STARTPOS", "起点位置（m）");
                    ccDeviceDetail.AddMember("EM_Temfiber.ENDPOS", "终止位置（m）");
                    ccDeviceDetail.AddMember("EM_Temfiber.INSTALLUNIT", "安装位置");
                    break;
                case "光纤测温主机":
                    ccDeviceDetail.AddMember("EM_Tempmain.CHANNELS", "使用通道数");
                    break;
                case "电缆终端":
                    ccDeviceDetail.AddMember("EM_Term.POS", "位置");
                    ccDeviceDetail.AddMember("EM_Term.LINENAME", "线路名称");
                    ccDeviceDetail.AddMember("EM_Term.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Term.TYPE", "类型");
                    ccDeviceDetail.AddMember("EM_Term.PHASE", "相位");
                    break;
                case "终端塔":
                    ccDeviceDetail.AddMember("EM_Terminal.XPOS", "X坐标");
                    ccDeviceDetail.AddMember("EM_Terminal.YPOS", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Terminal.INREGIONAL", "所在区域");
                    break;
                case "浅沟排管":
                    ccDeviceDetail.AddMember("EM_Trench.SECSIZE", "断面尺寸");
                    ccDeviceDetail.AddMember("EM_Trench.LENGTH", "长度");
                    ccDeviceDetail.AddMember("EM_Trench.WELLNUM", "井数量");
                    ccDeviceDetail.AddMember("EM_Trench.BEGINPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Trench.BPX", "起点x坐标");
                    ccDeviceDetail.AddMember("EM_Trench.BPY", "起点y坐标");
                    ccDeviceDetail.AddMember("EM_Trench.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Trench.EPX", "终点x坐标");
                    ccDeviceDetail.AddMember("EM_Trench.EPY", "终点y坐标");
                    ccDeviceDetail.AddMember("EM_Trench.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Trench.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Trench.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Trench.STRUCTURE", "结构形式");
                    ccDeviceDetail.AddMember("EM_Trench.SECURITYLEVEL", "保障等级");
                    break;
                case "电缆排管":
                    ccDeviceDetail.AddMember("EM_Tube.SECTIONTYPE", "截面类型");
                    ccDeviceDetail.AddMember("EM_Tube.MATERIAL", "材料");
                    ccDeviceDetail.AddMember("EM_Tube.DIAMETER", "管径");
                    ccDeviceDetail.AddMember("EM_Tube.LENGTH", "管道长度");
                    ccDeviceDetail.AddMember("EM_Tube.WELLNUM", "井数量");
                    ccDeviceDetail.AddMember("EM_Tube.BEGINPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Tube.BPX", "起点x坐标");
                    ccDeviceDetail.AddMember("EM_Tube.BPY", "起点y坐标");
                    ccDeviceDetail.AddMember("EM_Tube.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Tube.EPX", "终点x坐标");
                    ccDeviceDetail.AddMember("EM_Tube.EPY", "终点y坐标");
                    ccDeviceDetail.AddMember("EM_Tube.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Tube.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Tube.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Tube.SECURITYLEVEL", "保障等级");
                    break;
                case "电力隧道":
                    ccDeviceDetail.AddMember("EM_Tunnel.DRAWNAME", "图纸名称");
                    ccDeviceDetail.AddMember("EM_Tunnel.SECTIONTYPE", "截面类型");
                    ccDeviceDetail.AddMember("EM_Tunnel.SECSIZE", "断面尺寸");
                    ccDeviceDetail.AddMember("EM_Tunnel.LENGTH", "隧道长度");
                    ccDeviceDetail.AddMember("EM_Tunnel.WELLNUM", "井数量");
                    ccDeviceDetail.AddMember("EM_Tunnel.BEGINPOS", "起点");
                    ccDeviceDetail.AddMember("EM_Tunnel.BPX", "起点x坐标");
                    ccDeviceDetail.AddMember("EM_Tunnel.BPY", "起点y坐标");
                    ccDeviceDetail.AddMember("EM_Tunnel.ENDPOS", "终点");
                    ccDeviceDetail.AddMember("EM_Tunnel.EPX", "终点x坐标");
                    ccDeviceDetail.AddMember("EM_Tunnel.EPY", "终点y坐标");
                    ccDeviceDetail.AddMember("EM_Tunnel.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Tunnel.INREGIONAL", "所在区域");
                    ccDeviceDetail.AddMember("EM_Tunnel.TERMBPOS", "测温光纤起点");
                    ccDeviceDetail.AddMember("EM_Tunnel.TERMEPOS", "测温光纤终点");
                    ccDeviceDetail.AddMember("EM_Tunnel.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Tunnel.STRUCTURE", "结构形式");
                    ccDeviceDetail.AddMember("EM_Tunnel.HOISTEDTYPE", "悬挂方式");
                    ccDeviceDetail.AddMember("EM_Tunnel.SECURITYLEVEL", "保障等级");
                    ccDeviceDetail.AddMember("EM_Tunnel.HIGHTWARNING", "高预警阈值");
                    ccDeviceDetail.AddMember("EM_Tunnel.HIGHTALARM", "高报警阈值");
                    ccDeviceDetail.AddMember("EM_Tunnel.TERMBDOT", "测温光纤起点点号");
                    ccDeviceDetail.AddMember("EM_Tunnel.TERMEDOT", "测温光纤终点点号");
                    ccDeviceDetail.AddMember("EM_Tunnel.TERMNAME", "测温光纤名称");
                    break;
                case "通风亭":
                    ccDeviceDetail.AddMember("EM_Vent.SPECSIZE", "规格尺寸");
                    ccDeviceDetail.AddMember("EM_Vent.XPOS", "X坐标");
                    ccDeviceDetail.AddMember("EM_Vent.YPOS", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Vent.CONS_NAME", "施工单位名称");
                    break;
                case "检查井":
                    ccDeviceDetail.AddMember("EM_Well.WELLTYPE", "井类型");
                    ccDeviceDetail.AddMember("EM_Well.WELLCOVER", "井盖类型");
                    ccDeviceDetail.AddMember("EM_Well.XPOS", "X坐标");
                    ccDeviceDetail.AddMember("EM_Well.YPOS", "Y坐标");
                    ccDeviceDetail.AddMember("EM_Well.BOREHEI", "井内高程");
                    ccDeviceDetail.AddMember("EM_Well.FLOORS", "平台层数");
                    ccDeviceDetail.AddMember("EM_Well.INUNIT", "所属单位");
                    ccDeviceDetail.AddMember("EM_Well.ISOUTLINES", "是否出线井");
                    ccDeviceDetail.AddMember("EM_Well.OUTLINENUM", "出线管数");
                    ccDeviceDetail.AddMember("EM_Well.USEOUTLINES", "已占用根数");
                    ccDeviceDetail.AddMember("EM_Well.CONS_NAME", "施工单位名称");
                    ccDeviceDetail.AddMember("EM_Well.INREGIONAL", "所在区域");
                    break;
                default:
                    break;
            }

        }

        private void bcOperate_OnButtonClick(object sender, int buttonIndex)
        {
            switch (buttonIndex)
            {
                case 0:
                    FormManage.GotoNext("FrmEquipGIS", new object[] {"FrmDeviceDetail", device }, new object[] {parentForm,device}, false);

                    break;
                case 2:
                    FormManage.GotoNext(parentForm, null, null, true);
                    break;

            }
        }

        private void btnPrior_Click(object sender, EventArgs e)
        {
            ccDeviceDetail.PreviousPage();
            lblDevicePageInfo.Text = ccDeviceDetail.CurrPageIndex.ToString() + "/" + ccDeviceDetail.PageCount.ToString();
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            ccDeviceDetail.NextPage();
            lblDevicePageInfo.Text = ccDeviceDetail.CurrPageIndex.ToString() + "/" + ccDeviceDetail.PageCount.ToString();
     
        }


    }
}